// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router/router.js';
import VueResource from 'vue-resource';
import store from './vuex/vuex.js';
import utils from './common/utils.js'; // 获取全局方法
import RS from 'common/routerSwitch.js';
import vueScroll from 'vue-scroller'; // 获取vueScroll

// import eventBus from 'common/eventBus.js';
Vue.use(VueResource); // 注册VueResource
Vue.use(vueScroll);
Vue.prototype.$utils = utils; // 注册全局方法
Vue.prototype.$RS = RS;

Vue.config.productionTip = false;

/* eslint-disable no-new */
let appVue = new Vue({
  el: '#westair',
  store,
  router,
  template: '<App/>',
  components: {
    App
  }
});
let opt = appVue.$children[0]._data;
console.log(opt)
let indexStr = appVue.$utils.getUrlKey('indexPage');
console.log('这是主页' + indexStr);
if (!indexStr) {
  // indexStr = 'flights'
  indexStr = 'index';
}
// console.log(indexStr);
router.push('/' + indexStr);
